package cre.spring.mvc.custom;

import org.springframework.beans.PropertyEditorRegistrar;
import org.springframework.beans.PropertyEditorRegistry;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @Author penglai
 * @Date 2017/4/26.
 */
public class DemoPropertyEditorRegistrars implements PropertyEditorRegistrar {

    @Override
    public void registerCustomEditors(PropertyEditorRegistry registry) {
        registry.registerCustomEditor(Date.class,
                new DemoDateEditor2(new SimpleDateFormat("yyyy-HH-dd"), true));
    }
}
